﻿using AutoMapper;
using Domain.Entity;
using Domain.Entity.Fy;
using Domain.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.HFService
{
	public class HFService : IHFService
	{
		private readonly IMapper mapper;
		private readonly IHFRepository hFRepository;

		public HFService(IMapper mapper, IHFRepository hFRepository) {
			this.mapper = mapper;
			this.hFRepository = hFRepository;
		}

		public Task<bool> DeleteHF(int id)
		{
			return hFRepository.DeleteHF(id);
		}

		public List<HF> GetHF(string HumanFileStatus, string? FirstKindName, string? SecondKindName, string? ThirdKindName, string? HumanMajorKindName, string? HunmaMajorName, DateTime? startDate, DateTime? endDate)
		{
			return hFRepository.GetHF(HumanFileStatus, FirstKindName, SecondKindName, ThirdKindName, HumanMajorKindName, HunmaMajorName, startDate, endDate);
		}

		public HFFy GetHFFy(int currentPage, int pageSize, string HumanFileStatus)
		{
			return hFRepository.GetHFFy(currentPage, pageSize, HumanFileStatus);
		}

		public Task<bool> HFAdd(HFDto hF)
		{
			HF h = mapper.Map<HF>(hF);
			return hFRepository.HFAdd(h);
		}


		public List<HF> SelectHf(string HumanFileStatus)
		{
			return hFRepository.SelectHf(HumanFileStatus);
		}


		public Task<bool> Updatehf(HFDto hF)
		{
			HF h = mapper.Map<HF>(hF);
			return hFRepository.Updatehf(h);
		}

		public Task<bool> Updatehfbiao(HFDto hF)
		{
			HF h = mapper.Map<HF>(hF);
			return hFRepository.Updatehfbiao(h);
		}

		public Task<bool> UpdatehfHumanFileStatus(HFDto hF)
		{
			HF h = mapper.Map<HF>(hF);
			return hFRepository.UpdatehfHumanFileStatus(h);
		}
	}
}
